package com.eqdd.yiqidian.ui.gongneng.kehu;

import android.databinding.DataBindingUtil;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.eqdd.yiqidian.AddKehuActivityCustom;
import com.eqdd.yiqidian.R;
import com.eqdd.yiqidian.bean.EditBean;
import com.eqdd.yiqidian.ui.base.BaseMultiEditActivity;
import com.eqdd.yiqidian.ui.select.SelectRichTextActivity;

import java.util.ArrayList;

public class AddJihuiActivity extends BaseMultiEditActivity {
    private AddKehuActivityCustom dataBinding;
    private String[] titles = new String[]{
            "机会名称",
            "机会分类",
            "客户",
            "联系人",
            "兴趣产品",
            "预期成交日期",
            "产品销售金额（元）",
            "预期金额（元）",
            "备注",
            "提醒"
    };
    private String[] hintTexts = new String[]{
            "请输入",
            "请选择",
            "确定客户",
            "请选择",
            "请输入",
            "请选择",
            "请输入",
            "请输入",
            "请输入",
            "请选择"
    };
    private int[] types = new int[]{
            0, 4, 4, 4, 0, 4, 0, 0, 0, 4
    };


    @Override
    public void initBinding() {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_add_kehu);
        initTopTitleBar(View.VISIBLE, "添加机会");

    }

    @Override
    public void initData() {
        initTopRightText("添加", v -> {
            startActivity(AddJihuiActivity.class);
        });
        for (int i = 0; i < titles.length; i++) {
            EditBean editBean = new EditBean();
            editBean.setTitle(titles[i]);
            editBean.setType(types[i]);
            editBean.setContent("");
            editBean.setTextTitle(titles[i]);
            editBean.setHint(hintTexts[i]);
            editBeans.add(editBean);
        }
        if (quickAdapter != null) {
            ArrayList<EditBean> temp = new ArrayList<>();
            temp.addAll(editBeans);
            quickAdapter.notifyDataChanged(temp, true);
        }
    }

    @Override
    protected RecyclerView initRecyclerView() {
        return dataBinding.recyclerView;
    }

    @Override
    public void itemClick(int p) {

        switch (p) {

        }
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {

        }
    }
}
